﻿using OA.Model.MyAttribute;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OA.Model.DB
{
    /// <summary>
    /// 往来单位
    /// </summary>
    [Table("RelatedCompany")]
    public class RelatedCompany :BaseInfo
    {
        [Display(Name= "公司名称")]
        [Tag(TagEnum.Text, "required", "公司名称", 2, 50)]
        [MaxLength(50)]
        public string Name { get; set; }

        /// <summary>
        /// 法人
        /// </summary>
        [MaxLength(10)]
        [Display(Name = "公司法人")]
        [Tag(TagEnum.Text, "required", "法人", 2, 50)]
        public string LegalPerson { get; set; }

        /// <summary>
        /// 开户银行
        /// </summary>
        [MaxLength(50)]
        [Display(Name = "开户银行")]
        [Tag(TagEnum.Text, "required", "开户银行", 2, 50)]
        public string BankOfDeposit { get; set; }

        /// <summary>
        /// 银行账号
        /// </summary>
        [MaxLength(50)]
        [Display(Name = "银行账号")]
        [Tag(TagEnum.Text, "required", "银行账号", 2, 50)]
        public string BankAccount { get; set; }

        /// <summary>
        /// 统一社会信用代码
        /// </summary>
        [MaxLength(50)]
        [Display(Name = "信用代码")]
        [Tag(TagEnum.Text, "required", "信用代码", 2, 50)]
        public string NO { get; set; }

        /// <summary>
        /// 添加人
        /// </summary>
        [MaxLength(10)]
        public string AddEmpID { get; set; }

        /// <summary>
        /// 电话
        /// </summary>
        [MaxLength(50)]
        [Display(Name = "公司电话")]
        [Tag(TagEnum.Text, "required", "公司电话", 2, 50)]
        public string Tel { get; set; }

        /// <summary>
        /// 供应商
        /// </summary>
        [Tag(TagEnum.Switch, "required", "供应商", 2, 50)]
        [Display(Name = "供应商")]
        public bool IsSupplier { get; set; }

        /// <summary>
        /// 客户
        /// </summary>
        [Tag(TagEnum.Switch, "required", "客户", 2, 50)]
        [Display(Name = "客户")]
        public bool IsCustomer { get; set; }

        [MaxLength(20)]
        public string Province { get; set; }

        [MaxLength(20)]
        public string City { get; set; }

        [MaxLength(20)]
        public string District { get; set; }

        [Display(Name = "详情地址")]
        [MaxLength(50)]
        [Tag(TagEnum.Text, "required", "详情地址", 2, 50)]
        public string Address { get; set; }


        public virtual ICollection<RelatedCompanyContacts> RelatedCompanyContacts { get; set; }

    }


}
